package com.mht.book.entity.user;


import com.mht.book.entity.book.BookList;
import com.mht.book.operation.Operations;

/**
 * @author wangfusheng
 * @version 1.0.0
 * @ClassName User.java
 * @Description TODO
 * @createTime 2022/12/312:18
 */
public abstract class User {
    protected String name;
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public User(String name) {
        this.name = name;
    }
    //存储接口对象的数组
    protected Operations[] ops;
    //定义一个抽象的菜单方法，由子类实现（因为管理员和普通用户的菜单是不一致的）
    public abstract int menu();
    public void doOperation(BookList bookList, int choice){
        ops[choice].work(bookList);
    }

    //扩展字段
    protected int isAmin;

    public int getIsAmin() {
        return isAmin;
    }

    public void setIsAmin(int isAmin) {
        this.isAmin = isAmin;
    }
}
